home *** CD-ROM | disk | FTP | other *** search
- /*
- * $RCSfile: link.h,v $
- * $Revision: 1.3 $
- * $Date: 1996/05/05 03:00:44 $
- */
- #ifndef __LINK_H__
- #define __LINK_H__
-
- /**********************************************************************
- * EXODUS Database Toolkit Software
- * Copyright (c) 1991 Computer Sciences Department, University of
- * Wisconsin -- Madison
- * All Rights Reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * THE COMPUTER SCIENCES DEPARTMENT OF THE UNIVERSITY OF WISCONSIN --
- * MADISON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION.
- * THE DEPARTMENT DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES
- * WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * The EXODUS Project Group requests users of this software to return
- * any improvements or extensions that they make to:
- *
- * EXODUS Project Group
- * c/o David J. DeWitt and Michael J. Carey
- * Computer Sciences Department
- * University of Wisconsin -- Madison
- * Madison, WI 53706
- *
- * or exodus@cs.wisc.edu
- *
- * In addition, the EXODUS Project Group requests that users grant the
- * Computer Sciences Department rights to redistribute these changes.
- **********************************************************************/
- /*
- * define structures for interfacing with the message system
- */
-
- /*
- * define the states of the link (used in LINK.flags below )
- */
- #define LINK_FREE 0x0 /* link is unused */
- #define LINK_LISTEN 0x2
- #define LINK_ACCEPT 0x4
- #define LINK_RECV 0x8
- #define LINK_SUSPEND 0x10
-
- /*
- * linkClasses
- */
- #define CL_UNUSED 0
- #define CL_CONNECT 1
- #define CL_DISK 2
- #define CL_CLIENT 3
- #define CL_MEDIA_RECOVERY 4
- #define CL_STDIN 5
- #define CL_DGRAM 6
- #define CL_TIMEDOUT 7
- #define CL_STDOUT 8
- #define CL_STDERR 9
-
- /* this cludge is modeled after MESSAGE definition and is necessary to
- hack around a bug in g++-2.7.2 in linux 1.3.98
- */
- struct Link_s {
- int id; /* index of element in Links array */
- ONE linkClass; /* CL_DISK, etc above */
- UONE flags; /* LINK_FREE, etc above */
- struct {
- /* Real types aren't used here because they cause a reference loop:
- * requires volume.h, which requires link.h
- */
- TWO /* VOLID */ volid;
- char /* VOLREC */ *ptr;
- } cached; /* for fast path */
- LISTELEMENT list; /* Free list uses this */
- LIST tcbList; /* threads waiting on this link */
- LIST volList; /* disks open by this link */
- LIST transList; /* transactions controlled by link */
- LIST resourceList; /* resources controlled by this link */
- SOCKADDR address; /* not really needed, but kept for future
- debugging or bookkeeping purposes */
- FOUR lastForceMark; /* force mark of last log page
- sent on this link, this should
- really be of type FORCEMARK,
- but it is defined in bf.h and
- inconvenient to get. */
-
- /* Would like this to be of type TIME, but for #includes */
- int lastTxEndTime; /* time of last abort or commit */
-
- int linkTransError;
- /* reason for previous transaction failure.
- Only set after a trans abort and reset
- to esmNOERROR when new trans is started. */
- };
- typedef struct Link_s LINK;
- #define link_s Link_s
- /*#define LINK struct link_s*/
- #endif __LINK_H__
-